<?php
/**
 * Trait Question
 * User: Administrator
 * Date: 2020/2/13 0013
 * Time: 下午 7:13
 */
namespace app\api\traits\model\questions;

Trait Question {

    public function examinationType()
    {
        return $this->belongsTo('ExaminationType', 'examination_type')->bind(['examination_type_title'=>'title']);
    }

    public function examinationSection()
    {
        return $this->belongsTo('ExaminationType', 'examination_section')->bind(['examination_section_title'=>'title']);
    }

    public function answer()
    {
        return $this->hasMany('Answer', 'qid');
    }

    public function doAnswer()
    {
        return $this->hasMany('DoAnswer', 'qid');
    }

}